package com.soft.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.soft.entity.Sushe;
import com.soft.service.SusheService;

@RestController

public class SusheController {
	@Autowired
	private SusheService susheService;
	@RequestMapping("/queryAllSushe")
    public List<Sushe> queryAll(){
        return susheService.queryAll();
	}
	@RequestMapping("/querryByFloor")
	public List<Sushe> queryByCapacity(String Name){
		return susheService.queryByCapacity(Name);
	}
	@RequestMapping("/sushe/insertOne")
	public String insertOne(String floorName, String capacityName) {
		int num=susheService.insertOne(floorName,capacityName);
		if(num==1) {
			return "加入成功";
		}else {
			return "加入失败";
		}
	}
	@RequestMapping("/sushe/deleteOne")
	public String deleteOne(String Sno) {
		int num=susheService.deleteOne(Sno);
		if(num==1){
			return "删除成功"; 
		}else {
			return "删除失败";
		}
	}
}
